#ifndef _H_IDATA_H_
#define	_H_IDATA_H_

#include "../typedefine.h"
#include "../SmartPtrDefine.h"

namespace QWER
{
	QCLASS COctStream;

	QDLL_EXPORT QINTERFACE IData
	{
#ifndef _USING_CLI
	public:
		virtual ~IData() { }
#endif

	public:
		virtual BOOLN CloneTo(PTR_OR_REF(IData) roData) QCONST_FUNC = 0;
		virtual CUniquePtr(IData) Clone() QCONST_FUNC = 0;

	protected:
		virtual void _Marshal(PTR_OR_REF(COctStream) os) QCONST_FUNC = 0;
		virtual void _UnMarshal(PTR_OR_REF(COctStream) os) = 0;

#ifdef _USING_CLI
	internal:
#else
	private:
		friend class COctStream;
#endif
		inline void _Serialize(PTR_OR_REF(COctStream) os) { _Marshal(os); }
		inline void _Deserialize(PTR_OR_REF(COctStream) os) { _UnMarshal(os); }
	};
};

#endif	/* IDATA_H */

